{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "b63552a8",
   "metadata": {},
   "source": [
    "# Pandas"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "f5629557",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "stock_change = np.random.normal(0,1, (10,5)) # 生成正态分布的数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "03c1f614",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[-0.70375003,  0.67012947, -0.18659414, -1.17866209, -2.01972135],\n",
       "       [-2.63036603, -1.28149737, -0.50083281, -1.45936397, -0.57714333],\n",
       "       [-0.76329492, -0.08521963, -1.16481748,  0.74422405, -0.12860788],\n",
       "       [ 0.38466673,  0.42693637,  0.61384196, -0.62839336, -1.09656648],\n",
       "       [-0.75224429, -0.15961787,  0.64425651,  0.43084929, -1.52665333],\n",
       "       [ 1.36781792,  2.13721125, -0.3061462 ,  0.48190579, -0.40979819],\n",
       "       [ 0.41431852,  0.29765833,  0.96500899,  0.85046994, -0.73798202],\n",
       "       [-0.30796448, -0.49655877, -0.14583481, -0.33705326,  0.09539709],\n",
       "       [ 0.76641724, -1.38834164, -0.50433902, -1.04722855,  1.15738037],\n",
       "       [-0.29000976,  0.24526526,  0.63550281,  0.34922658, -0.26332038]])"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "stock_change # npArrary"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "0e0c49ec",
   "metadata": {},
   "outputs": [],
   "source": [
    "stock_rice = pd.DataFrame(stock_change) # Api: pd.DataFrame(npArray)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "60af0077",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>0</th>\n",
       "      <th>1</th>\n",
       "      <th>2</th>\n",
       "      <th>3</th>\n",
       "      <th>4</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>-0.703750</td>\n",
       "      <td>0.670129</td>\n",
       "      <td>-0.186594</td>\n",
       "      <td>-1.178662</td>\n",
       "      <td>-2.019721</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>-2.630366</td>\n",
       "      <td>-1.281497</td>\n",
       "      <td>-0.500833</td>\n",
       "      <td>-1.459364</td>\n",
       "      <td>-0.577143</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>-0.763295</td>\n",
       "      <td>-0.085220</td>\n",
       "      <td>-1.164817</td>\n",
       "      <td>0.744224</td>\n",
       "      <td>-0.128608</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0.384667</td>\n",
       "      <td>0.426936</td>\n",
       "      <td>0.613842</td>\n",
       "      <td>-0.628393</td>\n",
       "      <td>-1.096566</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>-0.752244</td>\n",
       "      <td>-0.159618</td>\n",
       "      <td>0.644257</td>\n",
       "      <td>0.430849</td>\n",
       "      <td>-1.526653</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>1.367818</td>\n",
       "      <td>2.137211</td>\n",
       "      <td>-0.306146</td>\n",
       "      <td>0.481906</td>\n",
       "      <td>-0.409798</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>0.414319</td>\n",
       "      <td>0.297658</td>\n",
       "      <td>0.965009</td>\n",
       "      <td>0.850470</td>\n",
       "      <td>-0.737982</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>-0.307964</td>\n",
       "      <td>-0.496559</td>\n",
       "      <td>-0.145835</td>\n",
       "      <td>-0.337053</td>\n",
       "      <td>0.095397</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>0.766417</td>\n",
       "      <td>-1.388342</td>\n",
       "      <td>-0.504339</td>\n",
       "      <td>-1.047229</td>\n",
       "      <td>1.157380</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>-0.290010</td>\n",
       "      <td>0.245265</td>\n",
       "      <td>0.635503</td>\n",
       "      <td>0.349227</td>\n",
       "      <td>-0.263320</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          0         1         2         3         4\n",
       "0 -0.703750  0.670129 -0.186594 -1.178662 -2.019721\n",
       "1 -2.630366 -1.281497 -0.500833 -1.459364 -0.577143\n",
       "2 -0.763295 -0.085220 -1.164817  0.744224 -0.128608\n",
       "3  0.384667  0.426936  0.613842 -0.628393 -1.096566\n",
       "4 -0.752244 -0.159618  0.644257  0.430849 -1.526653\n",
       "5  1.367818  2.137211 -0.306146  0.481906 -0.409798\n",
       "6  0.414319  0.297658  0.965009  0.850470 -0.737982\n",
       "7 -0.307964 -0.496559 -0.145835 -0.337053  0.095397\n",
       "8  0.766417 -1.388342 -0.504339 -1.047229  1.157380\n",
       "9 -0.290010  0.245265  0.635503  0.349227 -0.263320"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "stock_rice"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "14e2de3f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "10"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "stock_rice.shape[0] # Api: pdDataFrame.shape[0] 行数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "bf0627a6",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "5"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "stock_rice.shape[1] # Api:pdDataFrame.shape[1] 列数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "e776638d",
   "metadata": {},
   "outputs": [],
   "source": [
    "stock_xsticks = [\"股票{}\".format(i+1) for i in range(stock_rice.shape[0])]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "id": "f4211fd2",
   "metadata": {},
   "outputs": [],
   "source": [
    "testFormatArray = [\"我是{}号{}\".format(i+1, i) for i in range(50)]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "af7cafbd",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['股票1', '股票2', '股票3', '股票4', '股票5', '股票6', '股票7', '股票8', '股票9', '股票10']"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "stock_xsticks"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "7222a162",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>0</th>\n",
       "      <th>1</th>\n",
       "      <th>2</th>\n",
       "      <th>3</th>\n",
       "      <th>4</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>股票1</th>\n",
       "      <td>-0.703750</td>\n",
       "      <td>0.670129</td>\n",
       "      <td>-0.186594</td>\n",
       "      <td>-1.178662</td>\n",
       "      <td>-2.019721</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>股票2</th>\n",
       "      <td>-2.630366</td>\n",
       "      <td>-1.281497</td>\n",
       "      <td>-0.500833</td>\n",
       "      <td>-1.459364</td>\n",
       "      <td>-0.577143</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>股票3</th>\n",
       "      <td>-0.763295</td>\n",
       "      <td>-0.085220</td>\n",
       "      <td>-1.164817</td>\n",
       "      <td>0.744224</td>\n",
       "      <td>-0.128608</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>股票4</th>\n",
       "      <td>0.384667</td>\n",
       "      <td>0.426936</td>\n",
       "      <td>0.613842</td>\n",
       "      <td>-0.628393</td>\n",
       "      <td>-1.096566</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>股票5</th>\n",
       "      <td>-0.752244</td>\n",
       "      <td>-0.159618</td>\n",
       "      <td>0.644257</td>\n",
       "      <td>0.430849</td>\n",
       "      <td>-1.526653</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>股票6</th>\n",
       "      <td>1.367818</td>\n",
       "      <td>2.137211</td>\n",
       "      <td>-0.306146</td>\n",
       "      <td>0.481906</td>\n",
       "      <td>-0.409798</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>股票7</th>\n",
       "      <td>0.414319</td>\n",
       "      <td>0.297658</td>\n",
       "      <td>0.965009</td>\n",
       "      <td>0.850470</td>\n",
       "      <td>-0.737982</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>股票8</th>\n",
       "      <td>-0.307964</td>\n",
       "      <td>-0.496559</td>\n",
       "      <td>-0.145835</td>\n",
       "      <td>-0.337053</td>\n",
       "      <td>0.095397</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>股票9</th>\n",
       "      <td>0.766417</td>\n",
       "      <td>-1.388342</td>\n",
       "      <td>-0.504339</td>\n",
       "      <td>-1.047229</td>\n",
       "      <td>1.157380</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>股票10</th>\n",
       "      <td>-0.290010</td>\n",
       "      <td>0.245265</td>\n",
       "      <td>0.635503</td>\n",
       "      <td>0.349227</td>\n",
       "      <td>-0.263320</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             0         1         2         3         4\n",
       "股票1  -0.703750  0.670129 -0.186594 -1.178662 -2.019721\n",
       "股票2  -2.630366 -1.281497 -0.500833 -1.459364 -0.577143\n",
       "股票3  -0.763295 -0.085220 -1.164817  0.744224 -0.128608\n",
       "股票4   0.384667  0.426936  0.613842 -0.628393 -1.096566\n",
       "股票5  -0.752244 -0.159618  0.644257  0.430849 -1.526653\n",
       "股票6   1.367818  2.137211 -0.306146  0.481906 -0.409798\n",
       "股票7   0.414319  0.297658  0.965009  0.850470 -0.737982\n",
       "股票8  -0.307964 -0.496559 -0.145835 -0.337053  0.095397\n",
       "股票9   0.766417 -1.388342 -0.504339 -1.047229  1.157380\n",
       "股票10 -0.290010  0.245265  0.635503  0.349227 -0.263320"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.DataFrame(stock_change, index=stock_xsticks)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "49c7b574",
   "metadata": {},
   "outputs": [],
   "source": [
    " date = pd.date_range(start=\"20230720\", periods=stock_rice.shape[1], freq=\"B\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "id": "5e1175b4",
   "metadata": {},
   "outputs": [],
   "source": [
    "dataTable = pd.DataFrame(stock_change,index=stock_xsticks, columns=date)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "id": "ddbec063",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>2023-07-20</th>\n",
       "      <th>2023-07-21</th>\n",
       "      <th>2023-07-24</th>\n",
       "      <th>2023-07-25</th>\n",
       "      <th>2023-07-26</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>股票1</th>\n",
       "      <td>-0.703750</td>\n",
       "      <td>0.670129</td>\n",
       "      <td>-0.186594</td>\n",
       "      <td>-1.178662</td>\n",
       "      <td>-2.019721</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>股票2</th>\n",
       "      <td>-2.630366</td>\n",
       "      <td>-1.281497</td>\n",
       "      <td>-0.500833</td>\n",
       "      <td>-1.459364</td>\n",
       "      <td>-0.577143</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>股票3</th>\n",
       "      <td>-0.763295</td>\n",
       "      <td>-0.085220</td>\n",
       "      <td>-1.164817</td>\n",
       "      <td>0.744224</td>\n",
       "      <td>-0.128608</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>股票4</th>\n",
       "      <td>0.384667</td>\n",
       "      <td>0.426936</td>\n",
       "      <td>0.613842</td>\n",
       "      <td>-0.628393</td>\n",
       "      <td>-1.096566</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>股票5</th>\n",
       "      <td>-0.752244</td>\n",
       "      <td>-0.159618</td>\n",
       "      <td>0.644257</td>\n",
       "      <td>0.430849</td>\n",
       "      <td>-1.526653</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>股票6</th>\n",
       "      <td>1.367818</td>\n",
       "      <td>2.137211</td>\n",
       "      <td>-0.306146</td>\n",
       "      <td>0.481906</td>\n",
       "      <td>-0.409798</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>股票7</th>\n",
       "      <td>0.414319</td>\n",
       "      <td>0.297658</td>\n",
       "      <td>0.965009</td>\n",
       "      <td>0.850470</td>\n",
       "      <td>-0.737982</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>股票8</th>\n",
       "      <td>-0.307964</td>\n",
       "      <td>-0.496559</td>\n",
       "      <td>-0.145835</td>\n",
       "      <td>-0.337053</td>\n",
       "      <td>0.095397</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>股票9</th>\n",
       "      <td>0.766417</td>\n",
       "      <td>-1.388342</td>\n",
       "      <td>-0.504339</td>\n",
       "      <td>-1.047229</td>\n",
       "      <td>1.157380</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>股票10</th>\n",
       "      <td>-0.290010</td>\n",
       "      <td>0.245265</td>\n",
       "      <td>0.635503</td>\n",
       "      <td>0.349227</td>\n",
       "      <td>-0.263320</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "      2023-07-20  2023-07-21  2023-07-24  2023-07-25  2023-07-26\n",
       "股票1    -0.703750    0.670129   -0.186594   -1.178662   -2.019721\n",
       "股票2    -2.630366   -1.281497   -0.500833   -1.459364   -0.577143\n",
       "股票3    -0.763295   -0.085220   -1.164817    0.744224   -0.128608\n",
       "股票4     0.384667    0.426936    0.613842   -0.628393   -1.096566\n",
       "股票5    -0.752244   -0.159618    0.644257    0.430849   -1.526653\n",
       "股票6     1.367818    2.137211   -0.306146    0.481906   -0.409798\n",
       "股票7     0.414319    0.297658    0.965009    0.850470   -0.737982\n",
       "股票8    -0.307964   -0.496559   -0.145835   -0.337053    0.095397\n",
       "股票9     0.766417   -1.388342   -0.504339   -1.047229    1.157380\n",
       "股票10   -0.290010    0.245265    0.635503    0.349227   -0.263320"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dataTable"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "717ccc28",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "id": "9187f37b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[-0.70375003,  0.67012947, -0.18659414, -1.17866209, -2.01972135],\n",
       "       [-2.63036603, -1.28149737, -0.50083281, -1.45936397, -0.57714333],\n",
       "       [-0.76329492, -0.08521963, -1.16481748,  0.74422405, -0.12860788],\n",
       "       [ 0.38466673,  0.42693637,  0.61384196, -0.62839336, -1.09656648],\n",
       "       [-0.75224429, -0.15961787,  0.64425651,  0.43084929, -1.52665333],\n",
       "       [ 1.36781792,  2.13721125, -0.3061462 ,  0.48190579, -0.40979819],\n",
       "       [ 0.41431852,  0.29765833,  0.96500899,  0.85046994, -0.73798202],\n",
       "       [-0.30796448, -0.49655877, -0.14583481, -0.33705326,  0.09539709],\n",
       "       [ 0.76641724, -1.38834164, -0.50433902, -1.04722855,  1.15738037],\n",
       "       [-0.29000976,  0.24526526,  0.63550281,  0.34922658, -0.26332038]])"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dataTable.values"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "id": "e5675e2e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "DatetimeIndex(['2023-07-20', '2023-07-21', '2023-07-24', '2023-07-25',\n",
       "               '2023-07-26'],\n",
       "              dtype='datetime64[ns]', freq='B')"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dataTable.columns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "id": "66c8692c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Index(['股票1', '股票2', '股票3', '股票4', '股票5', '股票6', '股票7', '股票8', '股票9', '股票10'], dtype='object')"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dataTable.index"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "id": "cde92466",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>股票1</th>\n",
       "      <th>股票2</th>\n",
       "      <th>股票3</th>\n",
       "      <th>股票4</th>\n",
       "      <th>股票5</th>\n",
       "      <th>股票6</th>\n",
       "      <th>股票7</th>\n",
       "      <th>股票8</th>\n",
       "      <th>股票9</th>\n",
       "      <th>股票10</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2023-07-20</th>\n",
       "      <td>-0.703750</td>\n",
       "      <td>-2.630366</td>\n",
       "      <td>-0.763295</td>\n",
       "      <td>0.384667</td>\n",
       "      <td>-0.752244</td>\n",
       "      <td>1.367818</td>\n",
       "      <td>0.414319</td>\n",
       "      <td>-0.307964</td>\n",
       "      <td>0.766417</td>\n",
       "      <td>-0.290010</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2023-07-21</th>\n",
       "      <td>0.670129</td>\n",
       "      <td>-1.281497</td>\n",
       "      <td>-0.085220</td>\n",
       "      <td>0.426936</td>\n",
       "      <td>-0.159618</td>\n",
       "      <td>2.137211</td>\n",
       "      <td>0.297658</td>\n",
       "      <td>-0.496559</td>\n",
       "      <td>-1.388342</td>\n",
       "      <td>0.245265</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2023-07-24</th>\n",
       "      <td>-0.186594</td>\n",
       "      <td>-0.500833</td>\n",
       "      <td>-1.164817</td>\n",
       "      <td>0.613842</td>\n",
       "      <td>0.644257</td>\n",
       "      <td>-0.306146</td>\n",
       "      <td>0.965009</td>\n",
       "      <td>-0.145835</td>\n",
       "      <td>-0.504339</td>\n",
       "      <td>0.635503</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2023-07-25</th>\n",
       "      <td>-1.178662</td>\n",
       "      <td>-1.459364</td>\n",
       "      <td>0.744224</td>\n",
       "      <td>-0.628393</td>\n",
       "      <td>0.430849</td>\n",
       "      <td>0.481906</td>\n",
       "      <td>0.850470</td>\n",
       "      <td>-0.337053</td>\n",
       "      <td>-1.047229</td>\n",
       "      <td>0.349227</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2023-07-26</th>\n",
       "      <td>-2.019721</td>\n",
       "      <td>-0.577143</td>\n",
       "      <td>-0.128608</td>\n",
       "      <td>-1.096566</td>\n",
       "      <td>-1.526653</td>\n",
       "      <td>-0.409798</td>\n",
       "      <td>-0.737982</td>\n",
       "      <td>0.095397</td>\n",
       "      <td>1.157380</td>\n",
       "      <td>-0.263320</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                 股票1       股票2       股票3       股票4       股票5       股票6  \\\n",
       "2023-07-20 -0.703750 -2.630366 -0.763295  0.384667 -0.752244  1.367818   \n",
       "2023-07-21  0.670129 -1.281497 -0.085220  0.426936 -0.159618  2.137211   \n",
       "2023-07-24 -0.186594 -0.500833 -1.164817  0.613842  0.644257 -0.306146   \n",
       "2023-07-25 -1.178662 -1.459364  0.744224 -0.628393  0.430849  0.481906   \n",
       "2023-07-26 -2.019721 -0.577143 -0.128608 -1.096566 -1.526653 -0.409798   \n",
       "\n",
       "                 股票7       股票8       股票9      股票10  \n",
       "2023-07-20  0.414319 -0.307964  0.766417 -0.290010  \n",
       "2023-07-21  0.297658 -0.496559 -1.388342  0.245265  \n",
       "2023-07-24  0.965009 -0.145835 -0.504339  0.635503  \n",
       "2023-07-25  0.850470 -0.337053 -1.047229  0.349227  \n",
       "2023-07-26 -0.737982  0.095397  1.157380 -0.263320  "
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dataTable.T"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "id": "73f8cfd8",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "10"
      ]
     },
     "execution_count": 37,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dataTable.T.shape[1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "id": "b140a99f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>2023-07-20</th>\n",
       "      <th>2023-07-21</th>\n",
       "      <th>2023-07-24</th>\n",
       "      <th>2023-07-25</th>\n",
       "      <th>2023-07-26</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>股票1</th>\n",
       "      <td>-0.703750</td>\n",
       "      <td>0.670129</td>\n",
       "      <td>-0.186594</td>\n",
       "      <td>-1.178662</td>\n",
       "      <td>-2.019721</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>股票2</th>\n",
       "      <td>-2.630366</td>\n",
       "      <td>-1.281497</td>\n",
       "      <td>-0.500833</td>\n",
       "      <td>-1.459364</td>\n",
       "      <td>-0.577143</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>股票3</th>\n",
       "      <td>-0.763295</td>\n",
       "      <td>-0.085220</td>\n",
       "      <td>-1.164817</td>\n",
       "      <td>0.744224</td>\n",
       "      <td>-0.128608</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     2023-07-20  2023-07-21  2023-07-24  2023-07-25  2023-07-26\n",
       "股票1   -0.703750    0.670129   -0.186594   -1.178662   -2.019721\n",
       "股票2   -2.630366   -1.281497   -0.500833   -1.459364   -0.577143\n",
       "股票3   -0.763295   -0.085220   -1.164817    0.744224   -0.128608"
      ]
     },
     "execution_count": 38,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dataTable.head(3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "id": "8088c4a1",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>2023-07-20</th>\n",
       "      <th>2023-07-21</th>\n",
       "      <th>2023-07-24</th>\n",
       "      <th>2023-07-25</th>\n",
       "      <th>2023-07-26</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>股票9</th>\n",
       "      <td>0.766417</td>\n",
       "      <td>-1.388342</td>\n",
       "      <td>-0.504339</td>\n",
       "      <td>-1.047229</td>\n",
       "      <td>1.15738</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>股票10</th>\n",
       "      <td>-0.290010</td>\n",
       "      <td>0.245265</td>\n",
       "      <td>0.635503</td>\n",
       "      <td>0.349227</td>\n",
       "      <td>-0.26332</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "      2023-07-20  2023-07-21  2023-07-24  2023-07-25  2023-07-26\n",
       "股票9     0.766417   -1.388342   -0.504339   -1.047229     1.15738\n",
       "股票10   -0.290010    0.245265    0.635503    0.349227    -0.26332"
      ]
     },
     "execution_count": 39,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dataTable.tail(2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "id": "14b212d9",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 重设索引\n",
    "newXsticks = [\"股票_{}\".format(i+1) for i in range(dataTable.shape[0])]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "5e5131b6",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "id": "6919e144",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['股票_1',\n",
       " '股票_2',\n",
       " '股票_3',\n",
       " '股票_4',\n",
       " '股票_5',\n",
       " '股票_6',\n",
       " '股票_7',\n",
       " '股票_8',\n",
       " '股票_9',\n",
       " '股票_10']"
      ]
     },
     "execution_count": 58,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "newXsticks"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "c079eb89",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "255122a0",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "id": "7c2cf57c",
   "metadata": {},
   "outputs": [],
   "source": [
    "dataTable.index = newXsticks"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "id": "87bc6429",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>2023-07-20</th>\n",
       "      <th>2023-07-21</th>\n",
       "      <th>2023-07-24</th>\n",
       "      <th>2023-07-25</th>\n",
       "      <th>2023-07-26</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>股票_1</th>\n",
       "      <td>-0.703750</td>\n",
       "      <td>0.670129</td>\n",
       "      <td>-0.186594</td>\n",
       "      <td>-1.178662</td>\n",
       "      <td>-2.019721</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>股票_2</th>\n",
       "      <td>-2.630366</td>\n",
       "      <td>-1.281497</td>\n",
       "      <td>-0.500833</td>\n",
       "      <td>-1.459364</td>\n",
       "      <td>-0.577143</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>股票_3</th>\n",
       "      <td>-0.763295</td>\n",
       "      <td>-0.085220</td>\n",
       "      <td>-1.164817</td>\n",
       "      <td>0.744224</td>\n",
       "      <td>-0.128608</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>股票_4</th>\n",
       "      <td>0.384667</td>\n",
       "      <td>0.426936</td>\n",
       "      <td>0.613842</td>\n",
       "      <td>-0.628393</td>\n",
       "      <td>-1.096566</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>股票_5</th>\n",
       "      <td>-0.752244</td>\n",
       "      <td>-0.159618</td>\n",
       "      <td>0.644257</td>\n",
       "      <td>0.430849</td>\n",
       "      <td>-1.526653</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>股票_6</th>\n",
       "      <td>1.367818</td>\n",
       "      <td>2.137211</td>\n",
       "      <td>-0.306146</td>\n",
       "      <td>0.481906</td>\n",
       "      <td>-0.409798</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>股票_7</th>\n",
       "      <td>0.414319</td>\n",
       "      <td>0.297658</td>\n",
       "      <td>0.965009</td>\n",
       "      <td>0.850470</td>\n",
       "      <td>-0.737982</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>股票_8</th>\n",
       "      <td>-0.307964</td>\n",
       "      <td>-0.496559</td>\n",
       "      <td>-0.145835</td>\n",
       "      <td>-0.337053</td>\n",
       "      <td>0.095397</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>股票_9</th>\n",
       "      <td>0.766417</td>\n",
       "      <td>-1.388342</td>\n",
       "      <td>-0.504339</td>\n",
       "      <td>-1.047229</td>\n",
       "      <td>1.157380</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>股票_10</th>\n",
       "      <td>-0.290010</td>\n",
       "      <td>0.245265</td>\n",
       "      <td>0.635503</td>\n",
       "      <td>0.349227</td>\n",
       "      <td>-0.263320</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       2023-07-20  2023-07-21  2023-07-24  2023-07-25  2023-07-26\n",
       "股票_1    -0.703750    0.670129   -0.186594   -1.178662   -2.019721\n",
       "股票_2    -2.630366   -1.281497   -0.500833   -1.459364   -0.577143\n",
       "股票_3    -0.763295   -0.085220   -1.164817    0.744224   -0.128608\n",
       "股票_4     0.384667    0.426936    0.613842   -0.628393   -1.096566\n",
       "股票_5    -0.752244   -0.159618    0.644257    0.430849   -1.526653\n",
       "股票_6     1.367818    2.137211   -0.306146    0.481906   -0.409798\n",
       "股票_7     0.414319    0.297658    0.965009    0.850470   -0.737982\n",
       "股票_8    -0.307964   -0.496559   -0.145835   -0.337053    0.095397\n",
       "股票_9     0.766417   -1.388342   -0.504339   -1.047229    1.157380\n",
       "股票_10   -0.290010    0.245265    0.635503    0.349227   -0.263320"
      ]
     },
     "execution_count": 50,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dataTable"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "id": "151cc600",
   "metadata": {},
   "outputs": [],
   "source": [
    "newXsticks = newXsticks"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "id": "e08c255c",
   "metadata": {},
   "outputs": [],
   "source": [
    "dataTable.index = newXsticks[0:10]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "id": "5babf0e6",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>2023-07-20</th>\n",
       "      <th>2023-07-21</th>\n",
       "      <th>2023-07-24</th>\n",
       "      <th>2023-07-25</th>\n",
       "      <th>2023-07-26</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>股票_1</th>\n",
       "      <td>-0.703750</td>\n",
       "      <td>0.670129</td>\n",
       "      <td>-0.186594</td>\n",
       "      <td>-1.178662</td>\n",
       "      <td>-2.019721</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>股票_2</th>\n",
       "      <td>-2.630366</td>\n",
       "      <td>-1.281497</td>\n",
       "      <td>-0.500833</td>\n",
       "      <td>-1.459364</td>\n",
       "      <td>-0.577143</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>股票_3</th>\n",
       "      <td>-0.763295</td>\n",
       "      <td>-0.085220</td>\n",
       "      <td>-1.164817</td>\n",
       "      <td>0.744224</td>\n",
       "      <td>-0.128608</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>股票_4</th>\n",
       "      <td>0.384667</td>\n",
       "      <td>0.426936</td>\n",
       "      <td>0.613842</td>\n",
       "      <td>-0.628393</td>\n",
       "      <td>-1.096566</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>股票_5</th>\n",
       "      <td>-0.752244</td>\n",
       "      <td>-0.159618</td>\n",
       "      <td>0.644257</td>\n",
       "      <td>0.430849</td>\n",
       "      <td>-1.526653</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>股票_6</th>\n",
       "      <td>1.367818</td>\n",
       "      <td>2.137211</td>\n",
       "      <td>-0.306146</td>\n",
       "      <td>0.481906</td>\n",
       "      <td>-0.409798</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>股票_7</th>\n",
       "      <td>0.414319</td>\n",
       "      <td>0.297658</td>\n",
       "      <td>0.965009</td>\n",
       "      <td>0.850470</td>\n",
       "      <td>-0.737982</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>股票_8</th>\n",
       "      <td>-0.307964</td>\n",
       "      <td>-0.496559</td>\n",
       "      <td>-0.145835</td>\n",
       "      <td>-0.337053</td>\n",
       "      <td>0.095397</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>股票_9</th>\n",
       "      <td>0.766417</td>\n",
       "      <td>-1.388342</td>\n",
       "      <td>-0.504339</td>\n",
       "      <td>-1.047229</td>\n",
       "      <td>1.157380</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>股票_10</th>\n",
       "      <td>-0.290010</td>\n",
       "      <td>0.245265</td>\n",
       "      <td>0.635503</td>\n",
       "      <td>0.349227</td>\n",
       "      <td>-0.263320</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       2023-07-20  2023-07-21  2023-07-24  2023-07-25  2023-07-26\n",
       "股票_1    -0.703750    0.670129   -0.186594   -1.178662   -2.019721\n",
       "股票_2    -2.630366   -1.281497   -0.500833   -1.459364   -0.577143\n",
       "股票_3    -0.763295   -0.085220   -1.164817    0.744224   -0.128608\n",
       "股票_4     0.384667    0.426936    0.613842   -0.628393   -1.096566\n",
       "股票_5    -0.752244   -0.159618    0.644257    0.430849   -1.526653\n",
       "股票_6     1.367818    2.137211   -0.306146    0.481906   -0.409798\n",
       "股票_7     0.414319    0.297658    0.965009    0.850470   -0.737982\n",
       "股票_8    -0.307964   -0.496559   -0.145835   -0.337053    0.095397\n",
       "股票_9     0.766417   -1.388342   -0.504339   -1.047229    1.157380\n",
       "股票_10   -0.290010    0.245265    0.635503    0.349227   -0.263320"
      ]
     },
     "execution_count": 65,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dataTable"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 75,
   "id": "d772d3c9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>2023-07-20</th>\n",
       "      <th>2023-07-21</th>\n",
       "      <th>2023-07-24</th>\n",
       "      <th>2023-07-25</th>\n",
       "      <th>2023-07-26</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>-0.703750</td>\n",
       "      <td>0.670129</td>\n",
       "      <td>-0.186594</td>\n",
       "      <td>-1.178662</td>\n",
       "      <td>-2.019721</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>-2.630366</td>\n",
       "      <td>-1.281497</td>\n",
       "      <td>-0.500833</td>\n",
       "      <td>-1.459364</td>\n",
       "      <td>-0.577143</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>-0.763295</td>\n",
       "      <td>-0.085220</td>\n",
       "      <td>-1.164817</td>\n",
       "      <td>0.744224</td>\n",
       "      <td>-0.128608</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0.384667</td>\n",
       "      <td>0.426936</td>\n",
       "      <td>0.613842</td>\n",
       "      <td>-0.628393</td>\n",
       "      <td>-1.096566</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>-0.752244</td>\n",
       "      <td>-0.159618</td>\n",
       "      <td>0.644257</td>\n",
       "      <td>0.430849</td>\n",
       "      <td>-1.526653</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>1.367818</td>\n",
       "      <td>2.137211</td>\n",
       "      <td>-0.306146</td>\n",
       "      <td>0.481906</td>\n",
       "      <td>-0.409798</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>0.414319</td>\n",
       "      <td>0.297658</td>\n",
       "      <td>0.965009</td>\n",
       "      <td>0.850470</td>\n",
       "      <td>-0.737982</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>-0.307964</td>\n",
       "      <td>-0.496559</td>\n",
       "      <td>-0.145835</td>\n",
       "      <td>-0.337053</td>\n",
       "      <td>0.095397</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>0.766417</td>\n",
       "      <td>-1.388342</td>\n",
       "      <td>-0.504339</td>\n",
       "      <td>-1.047229</td>\n",
       "      <td>1.157380</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>-0.290010</td>\n",
       "      <td>0.245265</td>\n",
       "      <td>0.635503</td>\n",
       "      <td>0.349227</td>\n",
       "      <td>-0.263320</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   2023-07-20  2023-07-21  2023-07-24  2023-07-25  2023-07-26\n",
       "0   -0.703750    0.670129   -0.186594   -1.178662   -2.019721\n",
       "1   -2.630366   -1.281497   -0.500833   -1.459364   -0.577143\n",
       "2   -0.763295   -0.085220   -1.164817    0.744224   -0.128608\n",
       "3    0.384667    0.426936    0.613842   -0.628393   -1.096566\n",
       "4   -0.752244   -0.159618    0.644257    0.430849   -1.526653\n",
       "5    1.367818    2.137211   -0.306146    0.481906   -0.409798\n",
       "6    0.414319    0.297658    0.965009    0.850470   -0.737982\n",
       "7   -0.307964   -0.496559   -0.145835   -0.337053    0.095397\n",
       "8    0.766417   -1.388342   -0.504339   -1.047229    1.157380\n",
       "9   -0.290010    0.245265    0.635503    0.349227   -0.263320"
      ]
     },
     "execution_count": 75,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dataTable.reset_index(drop=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 76,
   "id": "3060b828",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>2023-07-20</th>\n",
       "      <th>2023-07-21</th>\n",
       "      <th>2023-07-24</th>\n",
       "      <th>2023-07-25</th>\n",
       "      <th>2023-07-26</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>股票_1</th>\n",
       "      <td>-0.703750</td>\n",
       "      <td>0.670129</td>\n",
       "      <td>-0.186594</td>\n",
       "      <td>-1.178662</td>\n",
       "      <td>-2.019721</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>股票_2</th>\n",
       "      <td>-2.630366</td>\n",
       "      <td>-1.281497</td>\n",
       "      <td>-0.500833</td>\n",
       "      <td>-1.459364</td>\n",
       "      <td>-0.577143</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>股票_3</th>\n",
       "      <td>-0.763295</td>\n",
       "      <td>-0.085220</td>\n",
       "      <td>-1.164817</td>\n",
       "      <td>0.744224</td>\n",
       "      <td>-0.128608</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>股票_4</th>\n",
       "      <td>0.384667</td>\n",
       "      <td>0.426936</td>\n",
       "      <td>0.613842</td>\n",
       "      <td>-0.628393</td>\n",
       "      <td>-1.096566</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>股票_5</th>\n",
       "      <td>-0.752244</td>\n",
       "      <td>-0.159618</td>\n",
       "      <td>0.644257</td>\n",
       "      <td>0.430849</td>\n",
       "      <td>-1.526653</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>股票_6</th>\n",
       "      <td>1.367818</td>\n",
       "      <td>2.137211</td>\n",
       "      <td>-0.306146</td>\n",
       "      <td>0.481906</td>\n",
       "      <td>-0.409798</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>股票_7</th>\n",
       "      <td>0.414319</td>\n",
       "      <td>0.297658</td>\n",
       "      <td>0.965009</td>\n",
       "      <td>0.850470</td>\n",
       "      <td>-0.737982</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>股票_8</th>\n",
       "      <td>-0.307964</td>\n",
       "      <td>-0.496559</td>\n",
       "      <td>-0.145835</td>\n",
       "      <td>-0.337053</td>\n",
       "      <td>0.095397</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>股票_9</th>\n",
       "      <td>0.766417</td>\n",
       "      <td>-1.388342</td>\n",
       "      <td>-0.504339</td>\n",
       "      <td>-1.047229</td>\n",
       "      <td>1.157380</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>股票_10</th>\n",
       "      <td>-0.290010</td>\n",
       "      <td>0.245265</td>\n",
       "      <td>0.635503</td>\n",
       "      <td>0.349227</td>\n",
       "      <td>-0.263320</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       2023-07-20  2023-07-21  2023-07-24  2023-07-25  2023-07-26\n",
       "股票_1    -0.703750    0.670129   -0.186594   -1.178662   -2.019721\n",
       "股票_2    -2.630366   -1.281497   -0.500833   -1.459364   -0.577143\n",
       "股票_3    -0.763295   -0.085220   -1.164817    0.744224   -0.128608\n",
       "股票_4     0.384667    0.426936    0.613842   -0.628393   -1.096566\n",
       "股票_5    -0.752244   -0.159618    0.644257    0.430849   -1.526653\n",
       "股票_6     1.367818    2.137211   -0.306146    0.481906   -0.409798\n",
       "股票_7     0.414319    0.297658    0.965009    0.850470   -0.737982\n",
       "股票_8    -0.307964   -0.496559   -0.145835   -0.337053    0.095397\n",
       "股票_9     0.766417   -1.388342   -0.504339   -1.047229    1.157380\n",
       "股票_10   -0.290010    0.245265    0.635503    0.349227   -0.263320"
      ]
     },
     "execution_count": 76,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dataTable"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "40010419",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 71,
   "id": "79c1d4ff",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "5"
      ]
     },
     "execution_count": 71,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dataTable.shape[1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 72,
   "id": "5ffe4d13",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "DatetimeIndex(['2023-07-20', '2023-07-21', '2023-07-24', '2023-07-25',\n",
       "               '2023-07-26'],\n",
       "              dtype='datetime64[ns]', freq='B')"
      ]
     },
     "execution_count": 72,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dataTable.columns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "cfe48ede",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "bff0f7fb",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "id": "949de46d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>2023-07-20</th>\n",
       "      <th>2023-07-21</th>\n",
       "      <th>2023-07-24</th>\n",
       "      <th>2023-07-25</th>\n",
       "      <th>2023-07-26</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>股票_1</th>\n",
       "      <td>-0.703750</td>\n",
       "      <td>0.670129</td>\n",
       "      <td>-0.186594</td>\n",
       "      <td>-1.178662</td>\n",
       "      <td>-2.019721</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>股票_2</th>\n",
       "      <td>-2.630366</td>\n",
       "      <td>-1.281497</td>\n",
       "      <td>-0.500833</td>\n",
       "      <td>-1.459364</td>\n",
       "      <td>-0.577143</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>股票_3</th>\n",
       "      <td>-0.763295</td>\n",
       "      <td>-0.085220</td>\n",
       "      <td>-1.164817</td>\n",
       "      <td>0.744224</td>\n",
       "      <td>-0.128608</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>股票_4</th>\n",
       "      <td>0.384667</td>\n",
       "      <td>0.426936</td>\n",
       "      <td>0.613842</td>\n",
       "      <td>-0.628393</td>\n",
       "      <td>-1.096566</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>股票_5</th>\n",
       "      <td>-0.752244</td>\n",
       "      <td>-0.159618</td>\n",
       "      <td>0.644257</td>\n",
       "      <td>0.430849</td>\n",
       "      <td>-1.526653</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>股票_6</th>\n",
       "      <td>1.367818</td>\n",
       "      <td>2.137211</td>\n",
       "      <td>-0.306146</td>\n",
       "      <td>0.481906</td>\n",
       "      <td>-0.409798</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>股票_7</th>\n",
       "      <td>0.414319</td>\n",
       "      <td>0.297658</td>\n",
       "      <td>0.965009</td>\n",
       "      <td>0.850470</td>\n",
       "      <td>-0.737982</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>股票_8</th>\n",
       "      <td>-0.307964</td>\n",
       "      <td>-0.496559</td>\n",
       "      <td>-0.145835</td>\n",
       "      <td>-0.337053</td>\n",
       "      <td>0.095397</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>股票_9</th>\n",
       "      <td>0.766417</td>\n",
       "      <td>-1.388342</td>\n",
       "      <td>-0.504339</td>\n",
       "      <td>-1.047229</td>\n",
       "      <td>1.157380</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>股票_10</th>\n",
       "      <td>-0.290010</td>\n",
       "      <td>0.245265</td>\n",
       "      <td>0.635503</td>\n",
       "      <td>0.349227</td>\n",
       "      <td>-0.263320</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       2023-07-20  2023-07-21  2023-07-24  2023-07-25  2023-07-26\n",
       "股票_1    -0.703750    0.670129   -0.186594   -1.178662   -2.019721\n",
       "股票_2    -2.630366   -1.281497   -0.500833   -1.459364   -0.577143\n",
       "股票_3    -0.763295   -0.085220   -1.164817    0.744224   -0.128608\n",
       "股票_4     0.384667    0.426936    0.613842   -0.628393   -1.096566\n",
       "股票_5    -0.752244   -0.159618    0.644257    0.430849   -1.526653\n",
       "股票_6     1.367818    2.137211   -0.306146    0.481906   -0.409798\n",
       "股票_7     0.414319    0.297658    0.965009    0.850470   -0.737982\n",
       "股票_8    -0.307964   -0.496559   -0.145835   -0.337053    0.095397\n",
       "股票_9     0.766417   -1.388342   -0.504339   -1.047229    1.157380\n",
       "股票_10   -0.290010    0.245265    0.635503    0.349227   -0.263320"
      ]
     },
     "execution_count": 61,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dataTable"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "c87395fa",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 77,
   "id": "ddd53193",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 通过键值对创建dataframe\n",
    "kvTable = pd.DataFrame({\n",
    "    \"year\": [2022,2023,2024],\n",
    "    \"month\": [2,3,4],\n",
    "    \"day\": [22,23,24]\n",
    "})"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 78,
   "id": "07edbc24",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>year</th>\n",
       "      <th>month</th>\n",
       "      <th>day</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2022</td>\n",
       "      <td>2</td>\n",
       "      <td>22</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2023</td>\n",
       "      <td>3</td>\n",
       "      <td>23</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2024</td>\n",
       "      <td>4</td>\n",
       "      <td>24</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   year  month  day\n",
       "0  2022      2   22\n",
       "1  2023      3   23\n",
       "2  2024      4   24"
      ]
     },
     "execution_count": 78,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "kvTable"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 79,
   "id": "4cbd5da9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>month</th>\n",
       "      <th>day</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>year</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2022</th>\n",
       "      <td>2</td>\n",
       "      <td>22</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2023</th>\n",
       "      <td>3</td>\n",
       "      <td>23</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2024</th>\n",
       "      <td>4</td>\n",
       "      <td>24</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "      month  day\n",
       "year            \n",
       "2022      2   22\n",
       "2023      3   23\n",
       "2024      4   24"
      ]
     },
     "execution_count": 79,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "## 用某列作为新的索引\n",
    "kvTable.set_index(keys=[\"year\"])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 80,
   "id": "8b41da0b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>year</th>\n",
       "      <th>month</th>\n",
       "      <th>day</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2022</td>\n",
       "      <td>2</td>\n",
       "      <td>22</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2023</td>\n",
       "      <td>3</td>\n",
       "      <td>23</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2024</td>\n",
       "      <td>4</td>\n",
       "      <td>24</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   year  month  day\n",
       "0  2022      2   22\n",
       "1  2023      3   23\n",
       "2  2024      4   24"
      ]
     },
     "execution_count": 80,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "kvTable"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 81,
   "id": "13609ce9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>year</th>\n",
       "      <th>day</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>month</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2022</td>\n",
       "      <td>22</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>2023</td>\n",
       "      <td>23</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2024</td>\n",
       "      <td>24</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       year  day\n",
       "month           \n",
       "2      2022   22\n",
       "3      2023   23\n",
       "4      2024   24"
      ]
     },
     "execution_count": 81,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "kvTable.set_index(\"month\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 84,
   "id": "41cbb14c",
   "metadata": {},
   "outputs": [],
   "source": [
    "mulKvTable = kvTable.set_index([\"year\", \"month\"])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 88,
   "id": "74260dd9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "MultiIndex([(2022, 2),\n",
       "            (2023, 3),\n",
       "            (2024, 4)],\n",
       "           names=['year', 'month'])"
      ]
     },
     "execution_count": 88,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mulKvTable.index"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 89,
   "id": "d5d94f89",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Index(['day'], dtype='object')"
      ]
     },
     "execution_count": 89,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mulKvTable.columns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "56f5343a",
   "metadata": {},
   "outputs": [],
   "source": [
    "data = pd.read_csv(\"./database/2023-07能耗费用明细22.csv\",encoding = 'gb18030')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "f56caaf2",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Index(['企业名称', '租赁面积/㎡', '开始日期', '截止日期', '租赁天数', '总【占比】', '办公用房【占比】',\n",
       "       '测试机房【占比】', '办公【电费】【含税】', '测试机房【电费】【含税】', '【水费】【含税】', '餐厅【燃气费】【含税】',\n",
       "       '单位不含税合计', '单位税金合计', '单位含税合计'],\n",
       "      dtype='object')"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data.columns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "4a6a3fcc",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>企业名称</th>\n",
       "      <th>租赁面积/㎡</th>\n",
       "      <th>开始日期</th>\n",
       "      <th>截止日期</th>\n",
       "      <th>租赁天数</th>\n",
       "      <th>总【占比】</th>\n",
       "      <th>办公用房【占比】</th>\n",
       "      <th>测试机房【占比】</th>\n",
       "      <th>办公【电费】【含税】</th>\n",
       "      <th>测试机房【电费】【含税】</th>\n",
       "      <th>【水费】【含税】</th>\n",
       "      <th>餐厅【燃气费】【含税】</th>\n",
       "      <th>单位不含税合计</th>\n",
       "      <th>单位税金合计</th>\n",
       "      <th>单位含税合计</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>wy企业1333345</td>\n",
       "      <td>8</td>\n",
       "      <td>2023/5/1</td>\n",
       "      <td>2023/7/1</td>\n",
       "      <td>1</td>\n",
       "      <td>0.80%、21.60%、2.16%</td>\n",
       "      <td>0.10%、2.55%、1.02%</td>\n",
       "      <td>1.80%、62.30%、31.15%</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>wy企业3</td>\n",
       "      <td>1</td>\n",
       "      <td>2023/7/17</td>\n",
       "      <td>2024/7/31</td>\n",
       "      <td>15</td>\n",
       "      <td>100.00%、100.00%</td>\n",
       "      <td>100.00%、100.00%</td>\n",
       "      <td>100.00%、100.00%</td>\n",
       "      <td>0</td>\n",
       "      <td>200</td>\n",
       "      <td>178.26</td>\n",
       "      <td>200</td>\n",
       "      <td>524.02</td>\n",
       "      <td>54.24</td>\n",
       "      <td>578.26</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>wy企业3</td>\n",
       "      <td>1</td>\n",
       "      <td>2023/7/17</td>\n",
       "      <td>2024/7/31</td>\n",
       "      <td>15</td>\n",
       "      <td>100.00%、100.00%</td>\n",
       "      <td>100.00%、100.00%</td>\n",
       "      <td>100.00%、100.00%</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>wy企业3</td>\n",
       "      <td>1</td>\n",
       "      <td>2023/7/19</td>\n",
       "      <td>2024/7/1</td>\n",
       "      <td>13</td>\n",
       "      <td>100.00%、100.00%</td>\n",
       "      <td>100.00%、100.00%</td>\n",
       "      <td>100.00%、100.00%</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>wy企业4</td>\n",
       "      <td>1</td>\n",
       "      <td>2023/7/18</td>\n",
       "      <td>2024/8/1</td>\n",
       "      <td>14</td>\n",
       "      <td>0.13%、100.00%</td>\n",
       "      <td>0.13%、100.00%</td>\n",
       "      <td>0.13%、100.00%</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>83.19</td>\n",
       "      <td>0</td>\n",
       "      <td>76.32</td>\n",
       "      <td>6.87</td>\n",
       "      <td>83.19</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          企业名称  租赁面积/㎡       开始日期       截止日期  租赁天数               总【占比】  \\\n",
       "0  wy企业1333345       8   2023/5/1   2023/7/1     1  0.80%、21.60%、2.16%   \n",
       "1        wy企业3       1  2023/7/17  2024/7/31    15     100.00%、100.00%   \n",
       "2        wy企业3       1  2023/7/17  2024/7/31    15     100.00%、100.00%   \n",
       "3        wy企业3       1  2023/7/19   2024/7/1    13     100.00%、100.00%   \n",
       "4        wy企业4       1  2023/7/18   2024/8/1    14       0.13%、100.00%   \n",
       "\n",
       "            办公用房【占比】             测试机房【占比】  办公【电费】【含税】  测试机房【电费】【含税】  【水费】【含税】  \\\n",
       "0  0.10%、2.55%、1.02%  1.80%、62.30%、31.15%           0             0      0.00   \n",
       "1    100.00%、100.00%      100.00%、100.00%           0           200    178.26   \n",
       "2    100.00%、100.00%      100.00%、100.00%           0             0      0.00   \n",
       "3    100.00%、100.00%      100.00%、100.00%           0             0      0.00   \n",
       "4      0.13%、100.00%        0.13%、100.00%           0             0     83.19   \n",
       "\n",
       "   餐厅【燃气费】【含税】  单位不含税合计  单位税金合计  单位含税合计  \n",
       "0            0     0.00    0.00    0.00  \n",
       "1          200   524.02   54.24  578.26  \n",
       "2            0     0.00    0.00    0.00  \n",
       "3            0     0.00    0.00    0.00  \n",
       "4            0    76.32    6.87   83.19  "
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "5e0039dc",
   "metadata": {},
   "outputs": [],
   "source": [
    "simpledata = data.drop([\"办公【电费】【含税】\",\"办公用房【占比】\",\"测试机房【占比】\",\"【水费】【含税】\",\"餐厅【燃气费】【含税】\",\"总【占比】\", \"测试机房【电费】【含税】\"], axis=1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "7d89d803",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>企业名称</th>\n",
       "      <th>租赁面积/㎡</th>\n",
       "      <th>开始日期</th>\n",
       "      <th>截止日期</th>\n",
       "      <th>租赁天数</th>\n",
       "      <th>单位不含税合计</th>\n",
       "      <th>单位税金合计</th>\n",
       "      <th>单位含税合计</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>wy企业1333345</td>\n",
       "      <td>8</td>\n",
       "      <td>2023/5/1</td>\n",
       "      <td>2023/7/1</td>\n",
       "      <td>1</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>wy企业3</td>\n",
       "      <td>1</td>\n",
       "      <td>2023/7/17</td>\n",
       "      <td>2024/7/31</td>\n",
       "      <td>15</td>\n",
       "      <td>524.02</td>\n",
       "      <td>54.24</td>\n",
       "      <td>578.26</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>wy企业3</td>\n",
       "      <td>1</td>\n",
       "      <td>2023/7/17</td>\n",
       "      <td>2024/7/31</td>\n",
       "      <td>15</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>wy企业3</td>\n",
       "      <td>1</td>\n",
       "      <td>2023/7/19</td>\n",
       "      <td>2024/7/1</td>\n",
       "      <td>13</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>wy企业4</td>\n",
       "      <td>1</td>\n",
       "      <td>2023/7/18</td>\n",
       "      <td>2024/8/1</td>\n",
       "      <td>14</td>\n",
       "      <td>76.32</td>\n",
       "      <td>6.87</td>\n",
       "      <td>83.19</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>wy企业9</td>\n",
       "      <td>200</td>\n",
       "      <td>2023/7/1</td>\n",
       "      <td>2023/8/31</td>\n",
       "      <td>31</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>wy企业10</td>\n",
       "      <td>1</td>\n",
       "      <td>2023/7/11</td>\n",
       "      <td>2024/7/31</td>\n",
       "      <td>21</td>\n",
       "      <td>228.96</td>\n",
       "      <td>20.60</td>\n",
       "      <td>249.58</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>技术有限公司</td>\n",
       "      <td>23</td>\n",
       "      <td>2023/7/6</td>\n",
       "      <td>2023/7/22</td>\n",
       "      <td>22</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>技术有限公司</td>\n",
       "      <td>23</td>\n",
       "      <td>2023/7/11</td>\n",
       "      <td>2023/7/21</td>\n",
       "      <td>11</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>技术有限公司</td>\n",
       "      <td>22</td>\n",
       "      <td>2023/7/6</td>\n",
       "      <td>2023/7/21</td>\n",
       "      <td>21</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>技术有限公司</td>\n",
       "      <td>23</td>\n",
       "      <td>2023/7/3</td>\n",
       "      <td>2023/7/20</td>\n",
       "      <td>20</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>技术有限公司</td>\n",
       "      <td>222</td>\n",
       "      <td>2023/7/4</td>\n",
       "      <td>2023/12/30</td>\n",
       "      <td>31</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>香港8899</td>\n",
       "      <td>120</td>\n",
       "      <td>2023/7/17</td>\n",
       "      <td>2023/8/31</td>\n",
       "      <td>15</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>香港8899</td>\n",
       "      <td>120</td>\n",
       "      <td>2023/7/1</td>\n",
       "      <td>2024/8/31</td>\n",
       "      <td>31</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>香港8899</td>\n",
       "      <td>100</td>\n",
       "      <td>2023/7/1</td>\n",
       "      <td>2023/12/31</td>\n",
       "      <td>31</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>取暖费企业1</td>\n",
       "      <td>300</td>\n",
       "      <td>2023/7/17</td>\n",
       "      <td>2023/11/22</td>\n",
       "      <td>15</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>取暖费企业1</td>\n",
       "      <td>566</td>\n",
       "      <td>2023/7/18</td>\n",
       "      <td>2024/1/1</td>\n",
       "      <td>14</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>取暖费企业1</td>\n",
       "      <td>222</td>\n",
       "      <td>2023/7/18</td>\n",
       "      <td>2024/7/18</td>\n",
       "      <td>14</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>取暖费企业1</td>\n",
       "      <td>444</td>\n",
       "      <td>2023/7/18</td>\n",
       "      <td>2024/7/4</td>\n",
       "      <td>14</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>mo-企业对账名称-1</td>\n",
       "      <td>22</td>\n",
       "      <td>2023/7/7</td>\n",
       "      <td>2023/8/16</td>\n",
       "      <td>31</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>前途有限公司</td>\n",
       "      <td>1</td>\n",
       "      <td>2023/7/1</td>\n",
       "      <td>2023/7/7</td>\n",
       "      <td>7</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>前途有限公司</td>\n",
       "      <td>12</td>\n",
       "      <td>2023/7/1</td>\n",
       "      <td>2023/10/27</td>\n",
       "      <td>31</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>合并测试企业1</td>\n",
       "      <td>500</td>\n",
       "      <td>2023/7/19</td>\n",
       "      <td>2024/7/19</td>\n",
       "      <td>13</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>合并测试企业1</td>\n",
       "      <td>100</td>\n",
       "      <td>2023/7/19</td>\n",
       "      <td>2024/7/19</td>\n",
       "      <td>13</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>跨年企业1</td>\n",
       "      <td>333</td>\n",
       "      <td>2023/7/19</td>\n",
       "      <td>2025/12/31</td>\n",
       "      <td>897</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>跨年企业2</td>\n",
       "      <td>222</td>\n",
       "      <td>2023/7/20</td>\n",
       "      <td>2024/8/1</td>\n",
       "      <td>31</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "           企业名称  租赁面积/㎡       开始日期        截止日期  租赁天数  单位不含税合计  单位税金合计  单位含税合计\n",
       "0   wy企业1333345       8   2023/5/1    2023/7/1     1     0.00    0.00    0.00\n",
       "1         wy企业3       1  2023/7/17   2024/7/31    15   524.02   54.24  578.26\n",
       "2         wy企业3       1  2023/7/17   2024/7/31    15     0.00    0.00    0.00\n",
       "3         wy企业3       1  2023/7/19    2024/7/1    13     0.00    0.00    0.00\n",
       "4         wy企业4       1  2023/7/18    2024/8/1    14    76.32    6.87   83.19\n",
       "5         wy企业9     200   2023/7/1   2023/8/31    31     0.00    0.00    0.00\n",
       "6        wy企业10       1  2023/7/11   2024/7/31    21   228.96   20.60  249.58\n",
       "7        技术有限公司      23   2023/7/6   2023/7/22    22     0.00    0.00    0.00\n",
       "8        技术有限公司      23  2023/7/11   2023/7/21    11     0.00    0.00    0.00\n",
       "9        技术有限公司      22   2023/7/6   2023/7/21    21     0.00    0.00    0.00\n",
       "10       技术有限公司      23   2023/7/3   2023/7/20    20     0.00    0.00    0.00\n",
       "11       技术有限公司     222   2023/7/4  2023/12/30    31     0.00    0.00    0.00\n",
       "12       香港8899     120  2023/7/17   2023/8/31    15     0.00    0.00    0.00\n",
       "13       香港8899     120   2023/7/1   2024/8/31    31     0.00    0.00    0.00\n",
       "14       香港8899     100   2023/7/1  2023/12/31    31     0.00    0.00    0.00\n",
       "15       取暖费企业1     300  2023/7/17  2023/11/22    15     0.00    0.00    0.00\n",
       "16       取暖费企业1     566  2023/7/18    2024/1/1    14     0.00    0.00    0.00\n",
       "17       取暖费企业1     222  2023/7/18   2024/7/18    14     0.00    0.00    0.00\n",
       "18       取暖费企业1     444  2023/7/18    2024/7/4    14     0.00    0.00    0.00\n",
       "19  mo-企业对账名称-1      22   2023/7/7   2023/8/16    31     0.00    0.00    0.00\n",
       "20       前途有限公司       1   2023/7/1    2023/7/7     7     0.00    0.00    0.00\n",
       "21       前途有限公司      12   2023/7/1  2023/10/27    31     0.00    0.00    0.00\n",
       "22      合并测试企业1     500  2023/7/19   2024/7/19    13     0.00    0.00    0.00\n",
       "23      合并测试企业1     100  2023/7/19   2024/7/19    13     0.00    0.00    0.00\n",
       "24        跨年企业1     333  2023/7/19  2025/12/31   897     0.00    0.00    0.00\n",
       "25        跨年企业2     222  2023/7/20    2024/8/1    31     0.00    0.00    0.00"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "simpledata"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "fb7f0479",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'wy企业1333345'"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "## 先列 后行\n",
    "simpledata[\"企业名称\"][0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "id": "374105c6",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'wy企业1333345'"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "simpledata.loc[0][\"企业名称\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "id": "bfae7907",
   "metadata": {},
   "outputs": [],
   "source": [
    "simpledata = simpledata.set_index(\"企业名称\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "id": "41c5549b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>租赁面积/㎡</th>\n",
       "      <th>开始日期</th>\n",
       "      <th>截止日期</th>\n",
       "      <th>租赁天数</th>\n",
       "      <th>单位不含税合计</th>\n",
       "      <th>单位税金合计</th>\n",
       "      <th>单位含税合计</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>企业名称</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>wy企业1333345</th>\n",
       "      <td>8</td>\n",
       "      <td>2023/5/1</td>\n",
       "      <td>2023/7/1</td>\n",
       "      <td>1</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>wy企业3</th>\n",
       "      <td>1</td>\n",
       "      <td>2023/7/17</td>\n",
       "      <td>2024/7/31</td>\n",
       "      <td>15</td>\n",
       "      <td>524.02</td>\n",
       "      <td>54.24</td>\n",
       "      <td>578.26</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>wy企业3</th>\n",
       "      <td>1</td>\n",
       "      <td>2023/7/17</td>\n",
       "      <td>2024/7/31</td>\n",
       "      <td>15</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>wy企业3</th>\n",
       "      <td>1</td>\n",
       "      <td>2023/7/19</td>\n",
       "      <td>2024/7/1</td>\n",
       "      <td>13</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>wy企业4</th>\n",
       "      <td>1</td>\n",
       "      <td>2023/7/18</td>\n",
       "      <td>2024/8/1</td>\n",
       "      <td>14</td>\n",
       "      <td>76.32</td>\n",
       "      <td>6.87</td>\n",
       "      <td>83.19</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>wy企业9</th>\n",
       "      <td>200</td>\n",
       "      <td>2023/7/1</td>\n",
       "      <td>2023/8/31</td>\n",
       "      <td>31</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>wy企业10</th>\n",
       "      <td>1</td>\n",
       "      <td>2023/7/11</td>\n",
       "      <td>2024/7/31</td>\n",
       "      <td>21</td>\n",
       "      <td>228.96</td>\n",
       "      <td>20.60</td>\n",
       "      <td>249.58</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>技术有限公司</th>\n",
       "      <td>23</td>\n",
       "      <td>2023/7/6</td>\n",
       "      <td>2023/7/22</td>\n",
       "      <td>22</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>技术有限公司</th>\n",
       "      <td>23</td>\n",
       "      <td>2023/7/11</td>\n",
       "      <td>2023/7/21</td>\n",
       "      <td>11</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>技术有限公司</th>\n",
       "      <td>22</td>\n",
       "      <td>2023/7/6</td>\n",
       "      <td>2023/7/21</td>\n",
       "      <td>21</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>技术有限公司</th>\n",
       "      <td>23</td>\n",
       "      <td>2023/7/3</td>\n",
       "      <td>2023/7/20</td>\n",
       "      <td>20</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>技术有限公司</th>\n",
       "      <td>222</td>\n",
       "      <td>2023/7/4</td>\n",
       "      <td>2023/12/30</td>\n",
       "      <td>31</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>香港8899</th>\n",
       "      <td>120</td>\n",
       "      <td>2023/7/17</td>\n",
       "      <td>2023/8/31</td>\n",
       "      <td>15</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>香港8899</th>\n",
       "      <td>120</td>\n",
       "      <td>2023/7/1</td>\n",
       "      <td>2024/8/31</td>\n",
       "      <td>31</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>香港8899</th>\n",
       "      <td>100</td>\n",
       "      <td>2023/7/1</td>\n",
       "      <td>2023/12/31</td>\n",
       "      <td>31</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>取暖费企业1</th>\n",
       "      <td>300</td>\n",
       "      <td>2023/7/17</td>\n",
       "      <td>2023/11/22</td>\n",
       "      <td>15</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>取暖费企业1</th>\n",
       "      <td>566</td>\n",
       "      <td>2023/7/18</td>\n",
       "      <td>2024/1/1</td>\n",
       "      <td>14</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>取暖费企业1</th>\n",
       "      <td>222</td>\n",
       "      <td>2023/7/18</td>\n",
       "      <td>2024/7/18</td>\n",
       "      <td>14</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>取暖费企业1</th>\n",
       "      <td>444</td>\n",
       "      <td>2023/7/18</td>\n",
       "      <td>2024/7/4</td>\n",
       "      <td>14</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mo-企业对账名称-1</th>\n",
       "      <td>22</td>\n",
       "      <td>2023/7/7</td>\n",
       "      <td>2023/8/16</td>\n",
       "      <td>31</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>前途有限公司</th>\n",
       "      <td>1</td>\n",
       "      <td>2023/7/1</td>\n",
       "      <td>2023/7/7</td>\n",
       "      <td>7</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>前途有限公司</th>\n",
       "      <td>12</td>\n",
       "      <td>2023/7/1</td>\n",
       "      <td>2023/10/27</td>\n",
       "      <td>31</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>合并测试企业1</th>\n",
       "      <td>500</td>\n",
       "      <td>2023/7/19</td>\n",
       "      <td>2024/7/19</td>\n",
       "      <td>13</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>合并测试企业1</th>\n",
       "      <td>100</td>\n",
       "      <td>2023/7/19</td>\n",
       "      <td>2024/7/19</td>\n",
       "      <td>13</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>跨年企业1</th>\n",
       "      <td>333</td>\n",
       "      <td>2023/7/19</td>\n",
       "      <td>2025/12/31</td>\n",
       "      <td>897</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>跨年企业2</th>\n",
       "      <td>222</td>\n",
       "      <td>2023/7/20</td>\n",
       "      <td>2024/8/1</td>\n",
       "      <td>31</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             租赁面积/㎡       开始日期        截止日期  租赁天数  单位不含税合计  单位税金合计  单位含税合计\n",
       "企业名称                                                                     \n",
       "wy企业1333345       8   2023/5/1    2023/7/1     1     0.00    0.00    0.00\n",
       "wy企业3             1  2023/7/17   2024/7/31    15   524.02   54.24  578.26\n",
       "wy企业3             1  2023/7/17   2024/7/31    15     0.00    0.00    0.00\n",
       "wy企业3             1  2023/7/19    2024/7/1    13     0.00    0.00    0.00\n",
       "wy企业4             1  2023/7/18    2024/8/1    14    76.32    6.87   83.19\n",
       "wy企业9           200   2023/7/1   2023/8/31    31     0.00    0.00    0.00\n",
       "wy企业10            1  2023/7/11   2024/7/31    21   228.96   20.60  249.58\n",
       "技术有限公司           23   2023/7/6   2023/7/22    22     0.00    0.00    0.00\n",
       "技术有限公司           23  2023/7/11   2023/7/21    11     0.00    0.00    0.00\n",
       "技术有限公司           22   2023/7/6   2023/7/21    21     0.00    0.00    0.00\n",
       "技术有限公司           23   2023/7/3   2023/7/20    20     0.00    0.00    0.00\n",
       "技术有限公司          222   2023/7/4  2023/12/30    31     0.00    0.00    0.00\n",
       "香港8899          120  2023/7/17   2023/8/31    15     0.00    0.00    0.00\n",
       "香港8899          120   2023/7/1   2024/8/31    31     0.00    0.00    0.00\n",
       "香港8899          100   2023/7/1  2023/12/31    31     0.00    0.00    0.00\n",
       "取暖费企业1          300  2023/7/17  2023/11/22    15     0.00    0.00    0.00\n",
       "取暖费企业1          566  2023/7/18    2024/1/1    14     0.00    0.00    0.00\n",
       "取暖费企业1          222  2023/7/18   2024/7/18    14     0.00    0.00    0.00\n",
       "取暖费企业1          444  2023/7/18    2024/7/4    14     0.00    0.00    0.00\n",
       "mo-企业对账名称-1      22   2023/7/7   2023/8/16    31     0.00    0.00    0.00\n",
       "前途有限公司            1   2023/7/1    2023/7/7     7     0.00    0.00    0.00\n",
       "前途有限公司           12   2023/7/1  2023/10/27    31     0.00    0.00    0.00\n",
       "合并测试企业1         500  2023/7/19   2024/7/19    13     0.00    0.00    0.00\n",
       "合并测试企业1         100  2023/7/19   2024/7/19    13     0.00    0.00    0.00\n",
       "跨年企业1           333  2023/7/19  2025/12/31   897     0.00    0.00    0.00\n",
       "跨年企业2           222  2023/7/20    2024/8/1    31     0.00    0.00    0.00"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "simpledata"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 86,
   "id": "094cf4b0",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>租赁面积/㎡</th>\n",
       "      <th>租赁天数</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>企业名称</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>wy企业1333345</th>\n",
       "      <td>8</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             租赁面积/㎡  租赁天数\n",
       "企业名称                     \n",
       "wy企业1333345       8     1"
      ]
     },
     "execution_count": 86,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "simpledata.loc[[\"wy企业1333345\"],[\"租赁面积/㎡\",\"租赁天数\"]]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 88,
   "id": "99fee85c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "企业名称\n",
       "wy企业1333345     1\n",
       "wy企业3          15\n",
       "wy企业3          15\n",
       "wy企业3          13\n",
       "wy企业4          14\n",
       "wy企业9          31\n",
       "wy企业10         21\n",
       "Name: 租赁天数, dtype: int64"
      ]
     },
     "execution_count": 88,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "simpledata.loc[\"wy企业1333345\":\"wy企业10\"][\"租赁天数\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 93,
   "id": "09c2b88f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>租赁面积/㎡</th>\n",
       "      <th>租赁天数</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>企业名称</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>wy企业1333345</th>\n",
       "      <td>8</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>wy企业10</th>\n",
       "      <td>1</td>\n",
       "      <td>21</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             租赁面积/㎡  租赁天数\n",
       "企业名称                     \n",
       "wy企业1333345       8     1\n",
       "wy企业10            1    21"
      ]
     },
     "execution_count": 93,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "simpledata.loc[[\"wy企业1333345\",\"wy企业10\"], [\"租赁面积/㎡\",\"租赁天数\"]]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 94,
   "id": "0c1212a7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>租赁面积/㎡</th>\n",
       "      <th>租赁天数</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>企业名称</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>wy企业1333345</th>\n",
       "      <td>8</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             租赁面积/㎡  租赁天数\n",
       "企业名称                     \n",
       "wy企业1333345       8     1"
      ]
     },
     "execution_count": 94,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "simpledata.loc[[\"wy企业1333345\"], [\"租赁面积/㎡\",\"租赁天数\"]]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "id": "3e43a4f6",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>租赁面积/㎡</th>\n",
       "      <th>开始日期</th>\n",
       "      <th>截止日期</th>\n",
       "      <th>租赁天数</th>\n",
       "      <th>单位不含税合计</th>\n",
       "      <th>单位税金合计</th>\n",
       "      <th>单位含税合计</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>企业名称</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>wy企业1333345</th>\n",
       "      <td>8</td>\n",
       "      <td>2023/5/1</td>\n",
       "      <td>2023/7/1</td>\n",
       "      <td>1</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>wy企业3</th>\n",
       "      <td>1</td>\n",
       "      <td>2023/7/17</td>\n",
       "      <td>2024/7/31</td>\n",
       "      <td>15</td>\n",
       "      <td>524.02</td>\n",
       "      <td>54.24</td>\n",
       "      <td>578.26</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>wy企业3</th>\n",
       "      <td>1</td>\n",
       "      <td>2023/7/17</td>\n",
       "      <td>2024/7/31</td>\n",
       "      <td>15</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             租赁面积/㎡       开始日期       截止日期  租赁天数  单位不含税合计  单位税金合计  单位含税合计\n",
       "企业名称                                                                    \n",
       "wy企业1333345       8   2023/5/1   2023/7/1     1     0.00    0.00    0.00\n",
       "wy企业3             1  2023/7/17  2024/7/31    15   524.02   54.24  578.26\n",
       "wy企业3             1  2023/7/17  2024/7/31    15     0.00    0.00    0.00"
      ]
     },
     "execution_count": 54,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "simpledata.iloc[:3][:5]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "id": "dde68aaa",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>开始日期</th>\n",
       "      <th>单位不含税合计</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>企业名称</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>wy企业1333345</th>\n",
       "      <td>2023/5/1</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>wy企业3</th>\n",
       "      <td>2023/7/17</td>\n",
       "      <td>524.02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>wy企业3</th>\n",
       "      <td>2023/7/17</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>wy企业3</th>\n",
       "      <td>2023/7/19</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>wy企业3</th>\n",
       "      <td>2023/7/17</td>\n",
       "      <td>524.02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>wy企业3</th>\n",
       "      <td>2023/7/17</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>wy企业3</th>\n",
       "      <td>2023/7/19</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>wy企业3</th>\n",
       "      <td>2023/7/17</td>\n",
       "      <td>524.02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>wy企业3</th>\n",
       "      <td>2023/7/17</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>wy企业3</th>\n",
       "      <td>2023/7/19</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                  开始日期  单位不含税合计\n",
       "企业名称                           \n",
       "wy企业1333345   2023/5/1     0.00\n",
       "wy企业3        2023/7/17   524.02\n",
       "wy企业3        2023/7/17     0.00\n",
       "wy企业3        2023/7/19     0.00\n",
       "wy企业3        2023/7/17   524.02\n",
       "wy企业3        2023/7/17     0.00\n",
       "wy企业3        2023/7/19     0.00\n",
       "wy企业3        2023/7/17   524.02\n",
       "wy企业3        2023/7/17     0.00\n",
       "wy企业3        2023/7/19     0.00"
      ]
     },
     "execution_count": 64,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "simpledata.loc[simpledata.index[0:4],[ \"开始日期\",\"单位不含税合计\" ]]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 81,
   "id": "92899972",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>租赁面积/㎡</th>\n",
       "      <th>开始日期</th>\n",
       "      <th>截止日期</th>\n",
       "      <th>租赁天数</th>\n",
       "      <th>单位不含税合计</th>\n",
       "      <th>单位税金合计</th>\n",
       "      <th>单位含税合计</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>企业名称</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>wy企业3</th>\n",
       "      <td>1</td>\n",
       "      <td>2023/7/17</td>\n",
       "      <td>2024/7/31</td>\n",
       "      <td>15</td>\n",
       "      <td>524.02</td>\n",
       "      <td>54.24</td>\n",
       "      <td>578.26</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>wy企业10</th>\n",
       "      <td>1</td>\n",
       "      <td>2023/7/11</td>\n",
       "      <td>2024/7/31</td>\n",
       "      <td>21</td>\n",
       "      <td>228.96</td>\n",
       "      <td>20.60</td>\n",
       "      <td>249.58</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>wy企业4</th>\n",
       "      <td>1</td>\n",
       "      <td>2023/7/18</td>\n",
       "      <td>2024/8/1</td>\n",
       "      <td>14</td>\n",
       "      <td>76.32</td>\n",
       "      <td>6.87</td>\n",
       "      <td>83.19</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>wy企业1333345</th>\n",
       "      <td>8</td>\n",
       "      <td>2023/5/1</td>\n",
       "      <td>2023/7/1</td>\n",
       "      <td>1</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>取暖费企业1</th>\n",
       "      <td>300</td>\n",
       "      <td>2023/7/17</td>\n",
       "      <td>2023/11/22</td>\n",
       "      <td>15</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>跨年企业1</th>\n",
       "      <td>333</td>\n",
       "      <td>2023/7/19</td>\n",
       "      <td>2025/12/31</td>\n",
       "      <td>897</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>合并测试企业1</th>\n",
       "      <td>100</td>\n",
       "      <td>2023/7/19</td>\n",
       "      <td>2024/7/19</td>\n",
       "      <td>13</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>合并测试企业1</th>\n",
       "      <td>500</td>\n",
       "      <td>2023/7/19</td>\n",
       "      <td>2024/7/19</td>\n",
       "      <td>13</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>前途有限公司</th>\n",
       "      <td>12</td>\n",
       "      <td>2023/7/1</td>\n",
       "      <td>2023/10/27</td>\n",
       "      <td>31</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>前途有限公司</th>\n",
       "      <td>1</td>\n",
       "      <td>2023/7/1</td>\n",
       "      <td>2023/7/7</td>\n",
       "      <td>7</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mo-企业对账名称-1</th>\n",
       "      <td>22</td>\n",
       "      <td>2023/7/7</td>\n",
       "      <td>2023/8/16</td>\n",
       "      <td>31</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>取暖费企业1</th>\n",
       "      <td>444</td>\n",
       "      <td>2023/7/18</td>\n",
       "      <td>2024/7/4</td>\n",
       "      <td>14</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>取暖费企业1</th>\n",
       "      <td>222</td>\n",
       "      <td>2023/7/18</td>\n",
       "      <td>2024/7/18</td>\n",
       "      <td>14</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>取暖费企业1</th>\n",
       "      <td>566</td>\n",
       "      <td>2023/7/18</td>\n",
       "      <td>2024/1/1</td>\n",
       "      <td>14</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>香港8899</th>\n",
       "      <td>120</td>\n",
       "      <td>2023/7/1</td>\n",
       "      <td>2024/8/31</td>\n",
       "      <td>31</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>香港8899</th>\n",
       "      <td>100</td>\n",
       "      <td>2023/7/1</td>\n",
       "      <td>2023/12/31</td>\n",
       "      <td>31</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>香港8899</th>\n",
       "      <td>120</td>\n",
       "      <td>2023/7/17</td>\n",
       "      <td>2023/8/31</td>\n",
       "      <td>15</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>技术有限公司</th>\n",
       "      <td>222</td>\n",
       "      <td>2023/7/4</td>\n",
       "      <td>2023/12/30</td>\n",
       "      <td>31</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>技术有限公司</th>\n",
       "      <td>23</td>\n",
       "      <td>2023/7/3</td>\n",
       "      <td>2023/7/20</td>\n",
       "      <td>20</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>技术有限公司</th>\n",
       "      <td>22</td>\n",
       "      <td>2023/7/6</td>\n",
       "      <td>2023/7/21</td>\n",
       "      <td>21</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>技术有限公司</th>\n",
       "      <td>23</td>\n",
       "      <td>2023/7/11</td>\n",
       "      <td>2023/7/21</td>\n",
       "      <td>11</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>技术有限公司</th>\n",
       "      <td>23</td>\n",
       "      <td>2023/7/6</td>\n",
       "      <td>2023/7/22</td>\n",
       "      <td>22</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>wy企业9</th>\n",
       "      <td>200</td>\n",
       "      <td>2023/7/1</td>\n",
       "      <td>2023/8/31</td>\n",
       "      <td>31</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>wy企业3</th>\n",
       "      <td>1</td>\n",
       "      <td>2023/7/19</td>\n",
       "      <td>2024/7/1</td>\n",
       "      <td>13</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>wy企业3</th>\n",
       "      <td>1</td>\n",
       "      <td>2023/7/17</td>\n",
       "      <td>2024/7/31</td>\n",
       "      <td>15</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>跨年企业2</th>\n",
       "      <td>222</td>\n",
       "      <td>2023/7/20</td>\n",
       "      <td>2024/8/1</td>\n",
       "      <td>31</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             租赁面积/㎡       开始日期        截止日期  租赁天数  单位不含税合计  单位税金合计  单位含税合计\n",
       "企业名称                                                                     \n",
       "wy企业3             1  2023/7/17   2024/7/31    15   524.02   54.24  578.26\n",
       "wy企业10            1  2023/7/11   2024/7/31    21   228.96   20.60  249.58\n",
       "wy企业4             1  2023/7/18    2024/8/1    14    76.32    6.87   83.19\n",
       "wy企业1333345       8   2023/5/1    2023/7/1     1     0.00    0.00    0.00\n",
       "取暖费企业1          300  2023/7/17  2023/11/22    15     0.00    0.00    0.00\n",
       "跨年企业1           333  2023/7/19  2025/12/31   897     0.00    0.00    0.00\n",
       "合并测试企业1         100  2023/7/19   2024/7/19    13     0.00    0.00    0.00\n",
       "合并测试企业1         500  2023/7/19   2024/7/19    13     0.00    0.00    0.00\n",
       "前途有限公司           12   2023/7/1  2023/10/27    31     0.00    0.00    0.00\n",
       "前途有限公司            1   2023/7/1    2023/7/7     7     0.00    0.00    0.00\n",
       "mo-企业对账名称-1      22   2023/7/7   2023/8/16    31     0.00    0.00    0.00\n",
       "取暖费企业1          444  2023/7/18    2024/7/4    14     0.00    0.00    0.00\n",
       "取暖费企业1          222  2023/7/18   2024/7/18    14     0.00    0.00    0.00\n",
       "取暖费企业1          566  2023/7/18    2024/1/1    14     0.00    0.00    0.00\n",
       "香港8899          120   2023/7/1   2024/8/31    31     0.00    0.00    0.00\n",
       "香港8899          100   2023/7/1  2023/12/31    31     0.00    0.00    0.00\n",
       "香港8899          120  2023/7/17   2023/8/31    15     0.00    0.00    0.00\n",
       "技术有限公司          222   2023/7/4  2023/12/30    31     0.00    0.00    0.00\n",
       "技术有限公司           23   2023/7/3   2023/7/20    20     0.00    0.00    0.00\n",
       "技术有限公司           22   2023/7/6   2023/7/21    21     0.00    0.00    0.00\n",
       "技术有限公司           23  2023/7/11   2023/7/21    11     0.00    0.00    0.00\n",
       "技术有限公司           23   2023/7/6   2023/7/22    22     0.00    0.00    0.00\n",
       "wy企业9           200   2023/7/1   2023/8/31    31     0.00    0.00    0.00\n",
       "wy企业3             1  2023/7/19    2024/7/1    13     0.00    0.00    0.00\n",
       "wy企业3             1  2023/7/17   2024/7/31    15     0.00    0.00    0.00\n",
       "跨年企业2           222  2023/7/20    2024/8/1    31     0.00    0.00    0.00"
      ]
     },
     "execution_count": 81,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "simpledata.sort_values(by=[\"单位不含税合计\"], ascending=False) # asc 升序"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 82,
   "id": "f608971e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>租赁面积/㎡</th>\n",
       "      <th>开始日期</th>\n",
       "      <th>截止日期</th>\n",
       "      <th>租赁天数</th>\n",
       "      <th>单位不含税合计</th>\n",
       "      <th>单位税金合计</th>\n",
       "      <th>单位含税合计</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>企业名称</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>mo-企业对账名称-1</th>\n",
       "      <td>22</td>\n",
       "      <td>2023/7/7</td>\n",
       "      <td>2023/8/16</td>\n",
       "      <td>31</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>wy企业10</th>\n",
       "      <td>1</td>\n",
       "      <td>2023/7/11</td>\n",
       "      <td>2024/7/31</td>\n",
       "      <td>21</td>\n",
       "      <td>228.96</td>\n",
       "      <td>20.60</td>\n",
       "      <td>249.58</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>wy企业1333345</th>\n",
       "      <td>8</td>\n",
       "      <td>2023/5/1</td>\n",
       "      <td>2023/7/1</td>\n",
       "      <td>1</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>wy企业3</th>\n",
       "      <td>1</td>\n",
       "      <td>2023/7/17</td>\n",
       "      <td>2024/7/31</td>\n",
       "      <td>15</td>\n",
       "      <td>524.02</td>\n",
       "      <td>54.24</td>\n",
       "      <td>578.26</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>wy企业3</th>\n",
       "      <td>1</td>\n",
       "      <td>2023/7/17</td>\n",
       "      <td>2024/7/31</td>\n",
       "      <td>15</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>wy企业3</th>\n",
       "      <td>1</td>\n",
       "      <td>2023/7/19</td>\n",
       "      <td>2024/7/1</td>\n",
       "      <td>13</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>wy企业4</th>\n",
       "      <td>1</td>\n",
       "      <td>2023/7/18</td>\n",
       "      <td>2024/8/1</td>\n",
       "      <td>14</td>\n",
       "      <td>76.32</td>\n",
       "      <td>6.87</td>\n",
       "      <td>83.19</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>wy企业9</th>\n",
       "      <td>200</td>\n",
       "      <td>2023/7/1</td>\n",
       "      <td>2023/8/31</td>\n",
       "      <td>31</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>前途有限公司</th>\n",
       "      <td>1</td>\n",
       "      <td>2023/7/1</td>\n",
       "      <td>2023/7/7</td>\n",
       "      <td>7</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>前途有限公司</th>\n",
       "      <td>12</td>\n",
       "      <td>2023/7/1</td>\n",
       "      <td>2023/10/27</td>\n",
       "      <td>31</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>取暖费企业1</th>\n",
       "      <td>300</td>\n",
       "      <td>2023/7/17</td>\n",
       "      <td>2023/11/22</td>\n",
       "      <td>15</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>取暖费企业1</th>\n",
       "      <td>566</td>\n",
       "      <td>2023/7/18</td>\n",
       "      <td>2024/1/1</td>\n",
       "      <td>14</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>取暖费企业1</th>\n",
       "      <td>222</td>\n",
       "      <td>2023/7/18</td>\n",
       "      <td>2024/7/18</td>\n",
       "      <td>14</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>取暖费企业1</th>\n",
       "      <td>444</td>\n",
       "      <td>2023/7/18</td>\n",
       "      <td>2024/7/4</td>\n",
       "      <td>14</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>合并测试企业1</th>\n",
       "      <td>100</td>\n",
       "      <td>2023/7/19</td>\n",
       "      <td>2024/7/19</td>\n",
       "      <td>13</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>合并测试企业1</th>\n",
       "      <td>500</td>\n",
       "      <td>2023/7/19</td>\n",
       "      <td>2024/7/19</td>\n",
       "      <td>13</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>技术有限公司</th>\n",
       "      <td>23</td>\n",
       "      <td>2023/7/11</td>\n",
       "      <td>2023/7/21</td>\n",
       "      <td>11</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>技术有限公司</th>\n",
       "      <td>222</td>\n",
       "      <td>2023/7/4</td>\n",
       "      <td>2023/12/30</td>\n",
       "      <td>31</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>技术有限公司</th>\n",
       "      <td>23</td>\n",
       "      <td>2023/7/6</td>\n",
       "      <td>2023/7/22</td>\n",
       "      <td>22</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>技术有限公司</th>\n",
       "      <td>22</td>\n",
       "      <td>2023/7/6</td>\n",
       "      <td>2023/7/21</td>\n",
       "      <td>21</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>技术有限公司</th>\n",
       "      <td>23</td>\n",
       "      <td>2023/7/3</td>\n",
       "      <td>2023/7/20</td>\n",
       "      <td>20</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>跨年企业1</th>\n",
       "      <td>333</td>\n",
       "      <td>2023/7/19</td>\n",
       "      <td>2025/12/31</td>\n",
       "      <td>897</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>跨年企业2</th>\n",
       "      <td>222</td>\n",
       "      <td>2023/7/20</td>\n",
       "      <td>2024/8/1</td>\n",
       "      <td>31</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>香港8899</th>\n",
       "      <td>120</td>\n",
       "      <td>2023/7/1</td>\n",
       "      <td>2024/8/31</td>\n",
       "      <td>31</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>香港8899</th>\n",
       "      <td>100</td>\n",
       "      <td>2023/7/1</td>\n",
       "      <td>2023/12/31</td>\n",
       "      <td>31</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>香港8899</th>\n",
       "      <td>120</td>\n",
       "      <td>2023/7/17</td>\n",
       "      <td>2023/8/31</td>\n",
       "      <td>15</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             租赁面积/㎡       开始日期        截止日期  租赁天数  单位不含税合计  单位税金合计  单位含税合计\n",
       "企业名称                                                                     \n",
       "mo-企业对账名称-1      22   2023/7/7   2023/8/16    31     0.00    0.00    0.00\n",
       "wy企业10            1  2023/7/11   2024/7/31    21   228.96   20.60  249.58\n",
       "wy企业1333345       8   2023/5/1    2023/7/1     1     0.00    0.00    0.00\n",
       "wy企业3             1  2023/7/17   2024/7/31    15   524.02   54.24  578.26\n",
       "wy企业3             1  2023/7/17   2024/7/31    15     0.00    0.00    0.00\n",
       "wy企业3             1  2023/7/19    2024/7/1    13     0.00    0.00    0.00\n",
       "wy企业4             1  2023/7/18    2024/8/1    14    76.32    6.87   83.19\n",
       "wy企业9           200   2023/7/1   2023/8/31    31     0.00    0.00    0.00\n",
       "前途有限公司            1   2023/7/1    2023/7/7     7     0.00    0.00    0.00\n",
       "前途有限公司           12   2023/7/1  2023/10/27    31     0.00    0.00    0.00\n",
       "取暖费企业1          300  2023/7/17  2023/11/22    15     0.00    0.00    0.00\n",
       "取暖费企业1          566  2023/7/18    2024/1/1    14     0.00    0.00    0.00\n",
       "取暖费企业1          222  2023/7/18   2024/7/18    14     0.00    0.00    0.00\n",
       "取暖费企业1          444  2023/7/18    2024/7/4    14     0.00    0.00    0.00\n",
       "合并测试企业1         100  2023/7/19   2024/7/19    13     0.00    0.00    0.00\n",
       "合并测试企业1         500  2023/7/19   2024/7/19    13     0.00    0.00    0.00\n",
       "技术有限公司           23  2023/7/11   2023/7/21    11     0.00    0.00    0.00\n",
       "技术有限公司          222   2023/7/4  2023/12/30    31     0.00    0.00    0.00\n",
       "技术有限公司           23   2023/7/6   2023/7/22    22     0.00    0.00    0.00\n",
       "技术有限公司           22   2023/7/6   2023/7/21    21     0.00    0.00    0.00\n",
       "技术有限公司           23   2023/7/3   2023/7/20    20     0.00    0.00    0.00\n",
       "跨年企业1           333  2023/7/19  2025/12/31   897     0.00    0.00    0.00\n",
       "跨年企业2           222  2023/7/20    2024/8/1    31     0.00    0.00    0.00\n",
       "香港8899          120   2023/7/1   2024/8/31    31     0.00    0.00    0.00\n",
       "香港8899          100   2023/7/1  2023/12/31    31     0.00    0.00    0.00\n",
       "香港8899          120  2023/7/17   2023/8/31    15     0.00    0.00    0.00"
      ]
     },
     "execution_count": 82,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "simpledata.sort_index()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 95,
   "id": "ae0e2053",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>租赁面积/㎡</th>\n",
       "      <th>开始日期</th>\n",
       "      <th>截止日期</th>\n",
       "      <th>租赁天数</th>\n",
       "      <th>单位不含税合计</th>\n",
       "      <th>单位税金合计</th>\n",
       "      <th>单位含税合计</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>企业名称</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>香港8899</th>\n",
       "      <td>120</td>\n",
       "      <td>2023/7/1</td>\n",
       "      <td>2024/8/31</td>\n",
       "      <td>31</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>香港8899</th>\n",
       "      <td>120</td>\n",
       "      <td>2023/7/17</td>\n",
       "      <td>2023/8/31</td>\n",
       "      <td>15</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>香港8899</th>\n",
       "      <td>100</td>\n",
       "      <td>2023/7/1</td>\n",
       "      <td>2023/12/31</td>\n",
       "      <td>31</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>跨年企业2</th>\n",
       "      <td>222</td>\n",
       "      <td>2023/7/20</td>\n",
       "      <td>2024/8/1</td>\n",
       "      <td>31</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>跨年企业1</th>\n",
       "      <td>333</td>\n",
       "      <td>2023/7/19</td>\n",
       "      <td>2025/12/31</td>\n",
       "      <td>897</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>技术有限公司</th>\n",
       "      <td>23</td>\n",
       "      <td>2023/7/6</td>\n",
       "      <td>2023/7/22</td>\n",
       "      <td>22</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>技术有限公司</th>\n",
       "      <td>23</td>\n",
       "      <td>2023/7/11</td>\n",
       "      <td>2023/7/21</td>\n",
       "      <td>11</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>技术有限公司</th>\n",
       "      <td>22</td>\n",
       "      <td>2023/7/6</td>\n",
       "      <td>2023/7/21</td>\n",
       "      <td>21</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>技术有限公司</th>\n",
       "      <td>23</td>\n",
       "      <td>2023/7/3</td>\n",
       "      <td>2023/7/20</td>\n",
       "      <td>20</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>技术有限公司</th>\n",
       "      <td>222</td>\n",
       "      <td>2023/7/4</td>\n",
       "      <td>2023/12/30</td>\n",
       "      <td>31</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>合并测试企业1</th>\n",
       "      <td>100</td>\n",
       "      <td>2023/7/19</td>\n",
       "      <td>2024/7/19</td>\n",
       "      <td>13</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>合并测试企业1</th>\n",
       "      <td>500</td>\n",
       "      <td>2023/7/19</td>\n",
       "      <td>2024/7/19</td>\n",
       "      <td>13</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>取暖费企业1</th>\n",
       "      <td>300</td>\n",
       "      <td>2023/7/17</td>\n",
       "      <td>2023/11/22</td>\n",
       "      <td>15</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>取暖费企业1</th>\n",
       "      <td>566</td>\n",
       "      <td>2023/7/18</td>\n",
       "      <td>2024/1/1</td>\n",
       "      <td>14</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>取暖费企业1</th>\n",
       "      <td>222</td>\n",
       "      <td>2023/7/18</td>\n",
       "      <td>2024/7/18</td>\n",
       "      <td>14</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>取暖费企业1</th>\n",
       "      <td>444</td>\n",
       "      <td>2023/7/18</td>\n",
       "      <td>2024/7/4</td>\n",
       "      <td>14</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>前途有限公司</th>\n",
       "      <td>1</td>\n",
       "      <td>2023/7/1</td>\n",
       "      <td>2023/7/7</td>\n",
       "      <td>7</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>前途有限公司</th>\n",
       "      <td>12</td>\n",
       "      <td>2023/7/1</td>\n",
       "      <td>2023/10/27</td>\n",
       "      <td>31</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>wy企业9</th>\n",
       "      <td>200</td>\n",
       "      <td>2023/7/1</td>\n",
       "      <td>2023/8/31</td>\n",
       "      <td>31</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>wy企业4</th>\n",
       "      <td>1</td>\n",
       "      <td>2023/7/18</td>\n",
       "      <td>2024/8/1</td>\n",
       "      <td>14</td>\n",
       "      <td>76.32</td>\n",
       "      <td>6.87</td>\n",
       "      <td>83.19</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>wy企业3</th>\n",
       "      <td>1</td>\n",
       "      <td>2023/7/17</td>\n",
       "      <td>2024/7/31</td>\n",
       "      <td>15</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>wy企业3</th>\n",
       "      <td>1</td>\n",
       "      <td>2023/7/17</td>\n",
       "      <td>2024/7/31</td>\n",
       "      <td>15</td>\n",
       "      <td>524.02</td>\n",
       "      <td>54.24</td>\n",
       "      <td>578.26</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>wy企业3</th>\n",
       "      <td>1</td>\n",
       "      <td>2023/7/19</td>\n",
       "      <td>2024/7/1</td>\n",
       "      <td>13</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>wy企业1333345</th>\n",
       "      <td>8</td>\n",
       "      <td>2023/5/1</td>\n",
       "      <td>2023/7/1</td>\n",
       "      <td>1</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>wy企业10</th>\n",
       "      <td>1</td>\n",
       "      <td>2023/7/11</td>\n",
       "      <td>2024/7/31</td>\n",
       "      <td>21</td>\n",
       "      <td>228.96</td>\n",
       "      <td>20.60</td>\n",
       "      <td>249.58</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mo-企业对账名称-1</th>\n",
       "      <td>22</td>\n",
       "      <td>2023/7/7</td>\n",
       "      <td>2023/8/16</td>\n",
       "      <td>31</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             租赁面积/㎡       开始日期        截止日期  租赁天数  单位不含税合计  单位税金合计  单位含税合计\n",
       "企业名称                                                                     \n",
       "香港8899          120   2023/7/1   2024/8/31    31     0.00    0.00    0.00\n",
       "香港8899          120  2023/7/17   2023/8/31    15     0.00    0.00    0.00\n",
       "香港8899          100   2023/7/1  2023/12/31    31     0.00    0.00    0.00\n",
       "跨年企业2           222  2023/7/20    2024/8/1    31     0.00    0.00    0.00\n",
       "跨年企业1           333  2023/7/19  2025/12/31   897     0.00    0.00    0.00\n",
       "技术有限公司           23   2023/7/6   2023/7/22    22     0.00    0.00    0.00\n",
       "技术有限公司           23  2023/7/11   2023/7/21    11     0.00    0.00    0.00\n",
       "技术有限公司           22   2023/7/6   2023/7/21    21     0.00    0.00    0.00\n",
       "技术有限公司           23   2023/7/3   2023/7/20    20     0.00    0.00    0.00\n",
       "技术有限公司          222   2023/7/4  2023/12/30    31     0.00    0.00    0.00\n",
       "合并测试企业1         100  2023/7/19   2024/7/19    13     0.00    0.00    0.00\n",
       "合并测试企业1         500  2023/7/19   2024/7/19    13     0.00    0.00    0.00\n",
       "取暖费企业1          300  2023/7/17  2023/11/22    15     0.00    0.00    0.00\n",
       "取暖费企业1          566  2023/7/18    2024/1/1    14     0.00    0.00    0.00\n",
       "取暖费企业1          222  2023/7/18   2024/7/18    14     0.00    0.00    0.00\n",
       "取暖费企业1          444  2023/7/18    2024/7/4    14     0.00    0.00    0.00\n",
       "前途有限公司            1   2023/7/1    2023/7/7     7     0.00    0.00    0.00\n",
       "前途有限公司           12   2023/7/1  2023/10/27    31     0.00    0.00    0.00\n",
       "wy企业9           200   2023/7/1   2023/8/31    31     0.00    0.00    0.00\n",
       "wy企业4             1  2023/7/18    2024/8/1    14    76.32    6.87   83.19\n",
       "wy企业3             1  2023/7/17   2024/7/31    15     0.00    0.00    0.00\n",
       "wy企业3             1  2023/7/17   2024/7/31    15   524.02   54.24  578.26\n",
       "wy企业3             1  2023/7/19    2024/7/1    13     0.00    0.00    0.00\n",
       "wy企业1333345       8   2023/5/1    2023/7/1     1     0.00    0.00    0.00\n",
       "wy企业10            1  2023/7/11   2024/7/31    21   228.96   20.60  249.58\n",
       "mo-企业对账名称-1      22   2023/7/7   2023/8/16    31     0.00    0.00    0.00"
      ]
     },
     "execution_count": 95,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "simpledata.sort_index(ascending=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "73715f59",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "0ee2fa97",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "a8e1dde5",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "85cb65a3",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "5851f568",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "fd46e4cc",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "0ffc4885",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "9e26e4f5",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "81083d12",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "6f853bde",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "417d1fb0",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "c6e7d1ce",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "d4dafb39",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "22cc6808",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "46b58c03",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "561299de",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.4"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {
    "height": "calc(100% - 180px)",
    "left": "10px",
    "top": "150px",
    "width": "252px"
   },
   "toc_section_display": true,
   "toc_window_display": true
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
